//
//  BiLoginViewController.m
//  TrunkIndustryManageSystem
//
//  Created by 李璐西 on 15-4-9.
//  Copyright (c) 2015年 李璐西. All rights reserved.
//

#import "BiLoginViewController.h"

@interface BiLoginViewController ()<UITextFieldDelegate>
{
    UITextField * _phoneTextField;
    UITextField * _pwdTextField;

}
@end

@implementation BiLoginViewController

- (void) viewDidLoad
{
    [super viewDidLoad];
    self.view.backgroundColor = UIColorFromRGB(0xe3e4e6);
    [self setNavBarWithHidden:NO];
    [self setNavBackBtn];
    
    UIImageView * imageView = [[UIImageView alloc] initWithFrame:CGRectMake((MAIN_SCREEN_WIDTH-97)/2, 64+25, 97, 84)];
    imageView.image = LOAD_IMAGE_WITH_CACHE(@"login/icon_logo.png");
    [self.view addSubview:imageView];
    [imageView release];
    
    // 员工号
    imageView = [[UIImageView alloc] initWithFrame:CGRectMake((MAIN_SCREEN_WIDTH-250)/2, 220, 250, 40)];
    imageView.image = LOAD_IMAGE_WITH_CACHE(@"login/icon_user.png");
    [self.view addSubview:imageView];
    [imageView release];
    
    CGRect rtPhoneText = imageView.frame;
    rtPhoneText.origin.x = (MAIN_SCREEN_WIDTH-250)/2 + 35;
    rtPhoneText.size.width = 220;
    _phoneTextField = [[UITextField alloc] initWithFrame:rtPhoneText];
    _phoneTextField.placeholder = @"员工号";
    _phoneTextField.textColor = [UIColor blackColor];
    _phoneTextField.font = [UIFont systemFontOfSize:16];
    //    代理
    [_phoneTextField setDelegate:self];
    [self.view addSubview:_phoneTextField];
//    FirstResponder
    
    [_phoneTextField release];
    
    // 密码
    imageView = [[UIImageView alloc] initWithFrame:CGRectMake((MAIN_SCREEN_WIDTH-250)/2, 279, 250, 40)];
    imageView.image = LOAD_IMAGE_WITH_CACHE(@"login/icon_password.png");
    [self.view addSubview:imageView];
    [imageView release];
    
    CGRect rtPwdText = imageView.frame;
    rtPwdText.origin.x = (MAIN_SCREEN_WIDTH-250)/2 + 35;
    rtPwdText.size.width = 220;
    _pwdTextField = [[UITextField alloc] initWithFrame:rtPwdText];
    _pwdTextField.placeholder = @"密码";
    _pwdTextField.textColor = [UIColor blackColor];
    _pwdTextField.font = [UIFont systemFontOfSize:16];
    _pwdTextField.secureTextEntry = YES;
    //    代理
    [_pwdTextField setDelegate:self];
    [self.view addSubview:_pwdTextField];
    [_pwdTextField release];
    
    UIButton * loginBtn = GET_BUTTON(CGRectMake((MAIN_SCREEN_WIDTH-250)/2, 345, 250, 40), 17, NO, [UIColor whiteColor]);
    [loginBtn setTitle:@"登    录" forState:UIControlStateNormal];
    [loginBtn setBackgroundImage:LOAD_IMAGE_WITH_CACHE(@"login/icon_login.png") forState:UIControlStateNormal];
    [loginBtn setTitleColor:[UIColor grayColor] forState:UIControlStateHighlighted];
    [loginBtn addTarget:self action:@selector(onLoginBtnClick:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:loginBtn];
}
- (void)onLoginBtnClick:(UIButton*)button
{
    
}
@end

